import request from '@/utils/request'

export function selectBook(data) {
  return request({
    url: '/book/select',
    method: 'post',
    data: data
  })
}
//   删除书籍

export function deleteBook(data) {
  return request({
    url: '/book/delete',
    method: 'post',
    data: data
  })
}

// 保存书籍
export function saveBook(data) {
  return request({
    url: '/book/save',
    method: 'post',
    data: data
  })
}
// 上传书籍

export function uploadBook(data) {
  return request({
    url: '/book/uploadBook',
    method: 'post',
    data: data
  })
}
// 修改书籍
export function updateBook(data) {
  return request({
    url: '/book/update',
    method: 'post',
    data: data
  })
}
// 下载书籍

export function downloadBook(data) {
  return request({
    responseType:"blob",
    url: '/book/download',
    method: 'get',
    params: data,
    
  })
}

// 我的书架

export function bookshelf(data) {
  return request({
    url: '/book/bookshelf',
    method: 'post',
    data: data
  })
}
// 获取喜欢状态

export function isLike(data) {
  return request({
    url: '/user-book/isLike',
    method: 'get',
    params: data
  })
}
export function likeBook(data) {
  return request({
    url: '/user-book/like',
    method: 'post',
    data: data
  })
}

export function dislikeBook(data) {
  return request({
    url: '/user-book/dislike',
    method: 'post',
    data: data
  })
}